<?php
$pageSize=Yii::app()->user->getState('pageSize',Yii::app()->params['defaultPageSize']);

$dialog = $this->widget('ext.ecolumns.EColumnsDialog', array(
   'options'=>array(
		'title' => 'Настройки',
		'autoOpen' => false,
		'show' =>  'fade',
		'hide' =>  'fade',
	),
   'htmlOptions' => array('style' => 'display: none'), //disable flush of dialog content
   'ecolumns' => array(
		'gridId' => 'statistic-grid', //id of related grid
		'storage' => 'session',  //where to store settings: 'db', 'session', 'cookie'
		'fixedLeft' => array('CCheckBoxColumn'), //fix checkbox to the left side 		
		'model' => $model->search(), //model is used to get attribute labels
		'columns' => array(
			array(
				'class'=>'bootstrap.widgets.TbButtonColumn',
				'template'=>'{delete} {view}',
				'htmlOptions' => array('style'=>'width:50px'),
				'header'=>'',
			),
			/*array
			(			
				'name'=>'type',
				'header'=>'Тип',					
				'value'=>'$data->type',
				'htmlOptions'=>array('style'=>'text-align: center'),
			),*/		
			array
			(			
				'name'=>'word',
				'header'=>'Слово',					
				'value'=>'$data->word',
				'htmlOptions'=>array('style'=>'text-align: center'),
			),		
			/*array
			(			
				'name'=>'rel',
				'header'=>'rel',					
				'value'=>'$data->rel',
				'htmlOptions'=>array('style'=>'text-align: center'),
			),	*/
			array
			(			
				'name'=>'href',
				'header'=>'Ссылка',					
				'value'=>'$data->href',
				'htmlOptions'=>array('style'=>'text-align: center'),
			),	
			array
			(			
				'name'=>'date',
				'header'=>'Дата',					
				'value'=>'$data->date',
				'htmlOptions'=>array('style'=>'text-align: center'),
			),	
			/*array
			(			
				'name'=>'show',
				'header'=>'Показы',					
				'value'=>'$data->show',
				'htmlOptions'=>array('style'=>'text-align: center'),
			),	
			array
			(			
				'name'=>'click',
				'header'=>'Клики',					
				'value'=>'$data->click',
				'htmlOptions'=>array('style'=>'text-align: center'),
			),*/			
		),
	),
));	

$this->widget('bootstrap.widgets.TbGridView', array(
    'id' => 'statistic-grid',
    'itemsCssClass'=>'default',
	'type'=>'striped bordered condensed',
    'dataProvider'=>$model->search(),
	'columns' => $dialog->columns(),
	'template' => "{summary}\n{items}\n{pager}",	
	'filter'=>$model,
));	
?>
